<table>
	<thead>
		<tr>
			<g:sortableColumn property="nome" title="${message(code: 'servidor.nome.label', default: 'Nome')}" />

			<g:sortableColumn property="executando" title="${message(code: 'servidor.executando.label', default: 'Executando')}" />

			<g:sortableColumn property="ip" title="${message(code: 'servidor.ip.label', default: 'Ip')}" />

			<g:sortableColumn property="porta" title="${message(code: 'servidor.porta.label', default: 'Porta')}" />

			<th></th>
		</tr>
	</thead>
	<tbody>
		<g:each in="${servidorInstanceList}" status="i" var="servidorInstance">
			<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
				<td>
					<g:link action="show" id="${servidorInstance.id}"> ${fieldValue(bean: servidorInstance, field: "nome")}</g:link>
				</td>
				<td>
					<g:formatBoolean boolean="${servidorInstance.executando}" />
				</td>
				<td>
					${fieldValue(bean: servidorInstance, field: "ip")}
				</td>
				<td>
					${fieldValue(bean: servidorInstance, field: "porta")}
				</td>
				<g:if test="${servidorInstance.executando}">
					<td>
						<input name="parar" value="${message(code: 'servidor.parar', default: 'Parar')}" size="6px" onclick="startstop(${servidorInstance.id}, 'stop');"/>
					</td>
				</g:if>
				<g:else>
					<td>
						<input type="button" name="start" value="${message(code: 'servidor.iniciar', default: 'Iniciar servidor')}" size="8px" onclick="startstop(${servidorInstance.id}, 'start');" />
					</td>
				</g:else>
			</tr>
		</g:each>
	</tbody>
</table>